;;;Add text to existing text before or after
;;;
;;;	AUTHOR: HENRY C. FRANCIS
;;;		425 N. ASHE ST.
;;;		SOUTHERN PINES, NC 28387
;;;              
;;;		All rights reserved without prejudice.
;;;	Copyright:	7-15-94
;;;	Edited:		8-22-2001
;;;
(DEFUN C:TXADD ( / tset tsln cntr tent edtw)
(setq addstrbf (ustr 1 "Text string to add before selected text (~ for none)" (IF (AND addstrbf (EQ (TYPE addstrbf) 'STR)) addstrbf "~") T))
(setq addstraf (ustr 1 "Text string to add after selected text (~ for none)" (IF (AND addstraf (EQ (TYPE addstraf) 'STR)) addstraf "~") T))
(IF (EQ addstrbf "~")
  (SETQ addstrbf "")
)
(IF (EQ addstraf "~")
  (SETQ addstraf "")
)
(prompt "\nSelect Text: ")
(setq tset (ssget '((0 . "TEXT"))))
(if tset
  (progn
    (setq tsln (sslength tset))
    (setq cntr 0)
  )
)
(while
  (if (and (< cntr tsln) tset)
    (setq tent (entget (ssname tset cntr)))
  );if
  (progn
    (setq edtw (entget (cdar tent)))
    (if (eq (cdr (assoc 0 edtw)) "TEXT")
      (progn
        (setq edtw
          (subst (cons 1 (STRCAT addstrbf (CDR (ASSOC 1 edtw)) addstraf))
                 (assoc 1 edtw)
                 edtw
          )
        )
        (entmod edtw)
      )
    )
    (setq cntr (1+ cntr))
  )
)
);DEFUN
